package me.siphone.model;

import android.os.Parcel;
import android.os.Parcelable;
import java.util.List;

public class Station implements Parcelable {
    private String sn;
    private String name;
    private List<Measurement> measurementList;

    public Station(String sn, String name, List<Measurement> measurementList) {
        this.sn = sn;
        this.name = name;
        this.measurementList = measurementList;
    }

    protected Station(Parcel in) {
        sn = in.readString();
        name = in.readString();
        measurementList = in.createTypedArrayList(Measurement.CREATOR);
    }

    public static final Creator<Station> CREATOR =
            new Creator<Station>() {
                @Override
                public Station createFromParcel(Parcel in) {
                    return new Station(in);
                }

                @Override
                public Station[] newArray(int size) {
                    return new Station[size];
                }
            };

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Measurement> getMeasurementList() {
        return measurementList;
    }

    public void setMeasurementList(List<Measurement> measurementList) {
        this.measurementList = measurementList;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(sn);
        dest.writeString(name);
        dest.writeTypedList(measurementList);
    }
}
